]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
telepathyClient: Use sent timestamp instead of received timestamp
authorJasper St. Pierre <jstpierre@mecheye.net>
Tue, 23 Aug 2011 17:38:51 +0000 (13:38 -0400)
committerJasper St. Pierre <jstpierre@mecheye.net>
Wed, 24 Aug 2011 15:18:58 +0000 (11:18 -0400)
It's generally more useful to see when a person sent a message instead of when
we received it. Also, a recent change in Telepathy made the received timestamp
be 0 for messages we send.

https://bugzilla.gnome.org/show_bug.cgi?id=640271

js/ui/telepathyClient.js

index de88c333153cd4383375bd35de4b840d0761eaea..7650d24eea8cd6e42098d4b48f709bdfe0ae99ca 100644 (file)
@@ -44,11 +44,16 @@ let contactFeatures = [Tp.ContactFeature.ALIAS,
 
 function makeMessageFromTpMessage(tpMessage, direction) {
     let [text, flags] = tpMessage.to_text();
+
+    let timestamp = tpMessage.get_sent_timestamp();
+    if (timestamp == 0)
+        timestamp = tpMessage.get_received_timestamp();
+
     return {
         messageType: tpMessage.get_message_type(),
         text: text,
         sender: tpMessage.sender.alias,
-        timestamp: tpMessage.get_received_timestamp(),
+        timestamp: timestamp,
         direction: direction
     };
 }